
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>CircuitVerse API Docs</title>

    <style>
      .highlight table td { padding: 5px; }
.highlight table pre { margin: 0; }
.highlight .gh {
  color: #999999;
}
.highlight .sr {
  color: #f6aa11;
}
.highlight .go {
  color: #888888;
}
.highlight .gp {
  color: #555555;
}
.highlight .gs {
}
.highlight .gu {
  color: #aaaaaa;
}
.highlight .nb {
  color: #f6aa11;
}
.highlight .cm {
  color: #75715e;
}
.highlight .cp {
  color: #75715e;
}
.highlight .c1 {
  color: #75715e;
}
.highlight .cs {
  color: #75715e;
}
.highlight .c, .highlight .cd {
  color: #75715e;
}
.highlight .err {
  color: #960050;
}
.highlight .gr {
  color: #960050;
}
.highlight .gt {
  color: #960050;
}
.highlight .gd {
  color: #49483e;
}
.highlight .gi {
  color: #49483e;
}
.highlight .ge {
  color: #49483e;
}
.highlight .kc {
  color: #66d9ef;
}
.highlight .kd {
  color: #66d9ef;
}
.highlight .kr {
  color: #66d9ef;
}
.highlight .no {
  color: #66d9ef;
}
.highlight .kt {
  color: #66d9ef;
}
.highlight .mf {
  color: #ae81ff;
}
.highlight .mh {
  color: #ae81ff;
}
.highlight .il {
  color: #ae81ff;
}
.highlight .mi {
  color: #ae81ff;
}
.highlight .mo {
  color: #ae81ff;
}
.highlight .m, .highlight .mb, .highlight .mx {
  color: #ae81ff;
}
.highlight .sc {
  color: #ae81ff;
}
.highlight .se {
  color: #ae81ff;
}
.highlight .ss {
  color: #ae81ff;
}
.highlight .sd {
  color: #e6db74;
}
.highlight .s2 {
  color: #e6db74;
}
.highlight .sb {
  color: #e6db74;
}
.highlight .sh {
  color: #e6db74;
}
.highlight .si {
  color: #e6db74;
}
.highlight .sx {
  color: #e6db74;
}
.highlight .s1 {
  color: #e6db74;
}
.highlight .s {
  color: #e6db74;
}
.highlight .na {
  color: #a6e22e;
}
.highlight .nc {
  color: #a6e22e;
}
.highlight .nd {
  color: #a6e22e;
}
.highlight .ne {
  color: #a6e22e;
}
.highlight .nf {
  color: #a6e22e;
}
.highlight .vc {
  color: #ffffff;
}
.highlight .nn {
  color: #ffffff;
}
.highlight .nl {
  color: #ffffff;
}
.highlight .ni {
  color: #ffffff;
}
.highlight .bp {
  color: #ffffff;
}
.highlight .vg {
  color: #ffffff;
}
.highlight .vi {
  color: #ffffff;
}
.highlight .nv {
  color: #ffffff;
}
.highlight .w {
  color: #ffffff;
}
.highlight {
  color: #ffffff;
}
.highlight .n, .highlight .py, .highlight .nx {
  color: #ffffff;
}
.highlight .ow {
  color: #f92672;
}
.highlight .nt {
  color: #f92672;
}
.highlight .k, .highlight .kv {
  color: #f92672;
}
.highlight .kn {
  color: #f92672;
}
.highlight .kp {
  color: #f92672;
}
.highlight .o {
  color: #f92672;
}
    </style>
    <link href="stylesheets/screen-a1ce949a.css" rel="stylesheet" media="screen" />
    <link href="stylesheets/print-bccf8c07.css" rel="stylesheet" media="print" />
      <script src="javascripts/all_nosearch-c275c2f6.js"></script>
  </head>

  <body class="index" data-languages="[&quot;http&quot;]">
    <a href="#" id="nav-button">
      <span>
        NAV
        <img src="images/navbar-cad8cdcb.png" alt="Navbar" />
      </span>
    </a>
    <div class="toc-wrapper">
      <img src="images/logo-1229a552.png" class="logo" alt="Logo" />
        <div class="lang-selector">
              <a href="#" data-language-name="http">http</a>
        </div>
      <ul id="toc" class="toc-list-h1">
          <li>
            <a href="#overview" class="toc-h1 toc-link" data-title="Overview">Overview</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#client-errors" class="toc-h2 toc-link" data-title="Client Errors">Client Errors</a>
                  </li>
                  <li>
                    <a href="#authorization" class="toc-h2 toc-link" data-title="Authorization">Authorization</a>
                  </li>
                  <li>
                    <a href="#pagination" class="toc-h2 toc-link" data-title="Pagination">Pagination</a>
                  </li>
                  <li>
                    <a href="#links" class="toc-h2 toc-link" data-title="Links">Links</a>
                  </li>
                  <li>
                    <a href="#cross-origin-resource-sharing" class="toc-h2 toc-link" data-title="Cross Origin Resource Sharing">Cross Origin Resource Sharing</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#authentication" class="toc-h1 toc-link" data-title="Authentication">Authentication</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#sign-up-a-user" class="toc-h2 toc-link" data-title="Sign Up a User">Sign Up a User</a>
                  </li>
                  <li>
                    <a href="#login-a-user" class="toc-h2 toc-link" data-title="Login a User">Login a User</a>
                  </li>
                  <li>
                    <a href="#reset-password-instructions" class="toc-h2 toc-link" data-title="Reset Password Instructions">Reset Password Instructions</a>
                  </li>
                  <li>
                    <a href="#get-public-key" class="toc-h2 toc-link" data-title="GET Public Key">GET Public Key</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#users" class="toc-h1 toc-link" data-title="Users">Users</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#get-all-users" class="toc-h2 toc-link" data-title="Get All Users">Get All Users</a>
                  </li>
                  <li>
                    <a href="#get-logged-in-user" class="toc-h2 toc-link" data-title="GET logged in User">GET logged in User</a>
                  </li>
                  <li>
                    <a href="#get-a-specific-user" class="toc-h2 toc-link" data-title="GET a Specific User">GET a Specific User</a>
                  </li>
                  <li>
                    <a href="#update-a-specific-user" class="toc-h2 toc-link" data-title="UPDATE a Specific User">UPDATE a Specific User</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#projects" class="toc-h1 toc-link" data-title="Projects">Projects</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#get-all-projects" class="toc-h2 toc-link" data-title="GET All Projects">GET All Projects</a>
                  </li>
                  <li>
                    <a href="#get-user-specific-projects" class="toc-h2 toc-link" data-title="GET User Specific Projects">GET User Specific Projects</a>
                  </li>
                  <li>
                    <a href="#get-project-details" class="toc-h2 toc-link" data-title="GET Project Details">GET Project Details</a>
                  </li>
                  <li>
                    <a href="#update-project" class="toc-h2 toc-link" data-title="UPDATE Project">UPDATE Project</a>
                  </li>
                  <li>
                    <a href="#delete-project" class="toc-h2 toc-link" data-title="DELETE Project">DELETE Project</a>
                  </li>
                  <li>
                    <a href="#get-featured-projects" class="toc-h2 toc-link" data-title="GET Featured Projects">GET Featured Projects</a>
                  </li>
                  <li>
                    <a href="#star-unstar-a-project" class="toc-h2 toc-link" data-title="STAR/UNSTAR a Project">STAR/UNSTAR a Project</a>
                  </li>
                  <li>
                    <a href="#fork-a-project" class="toc-h2 toc-link" data-title="FORK a Project">FORK a Project</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#collaborators" class="toc-h1 toc-link" data-title="Collaborators">Collaborators</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#get-all-project-collaborators" class="toc-h2 toc-link" data-title="GET All project collaborators">GET All project collaborators</a>
                  </li>
                  <li>
                    <a href="#create-add-collaborator" class="toc-h2 toc-link" data-title="CREATE/ADD Collaborator">CREATE/ADD Collaborator</a>
                  </li>
                  <li>
                    <a href="#delete-collaborator" class="toc-h2 toc-link" data-title="DELETE Collaborator">DELETE Collaborator</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#groups" class="toc-h1 toc-link" data-title="Groups">Groups</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#get-all-your-groups" class="toc-h2 toc-link" data-title="GET All your groups">GET All your groups</a>
                  </li>
                  <li>
                    <a href="#get-all-mentored-groups" class="toc-h2 toc-link" data-title="GET All mentored groups">GET All mentored groups</a>
                  </li>
                  <li>
                    <a href="#get-group-details" class="toc-h2 toc-link" data-title="GET Group Details">GET Group Details</a>
                  </li>
                  <li>
                    <a href="#update-group" class="toc-h2 toc-link" data-title="UPDATE Group">UPDATE Group</a>
                  </li>
                  <li>
                    <a href="#delete-group" class="toc-h2 toc-link" data-title="DELETE Group">DELETE Group</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#group-members" class="toc-h1 toc-link" data-title="Group Members">Group Members</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#get-all-group-members" class="toc-h2 toc-link" data-title="GET All group members">GET All group members</a>
                  </li>
                  <li>
                    <a href="#create-add-group-member" class="toc-h2 toc-link" data-title="CREATE/ADD Group Member">CREATE/ADD Group Member</a>
                  </li>
                  <li>
                    <a href="#delete-group-member" class="toc-h2 toc-link" data-title="DELETE Group Member">DELETE Group Member</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#assignments" class="toc-h1 toc-link" data-title="Assignments">Assignments</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#get-group-39-s-assignments" class="toc-h2 toc-link" data-title="GET Group's Assignments">GET Group's Assignments</a>
                  </li>
                  <li>
                    <a href="#get-assignment-details" class="toc-h2 toc-link" data-title="GET Assignment details">GET Assignment details</a>
                  </li>
                  <li>
                    <a href="#post-assignment" class="toc-h2 toc-link" data-title="POST Assignment">POST Assignment</a>
                  </li>
                  <li>
                    <a href="#update-assignment" class="toc-h2 toc-link" data-title="UPDATE Assignment">UPDATE Assignment</a>
                  </li>
                  <li>
                    <a href="#delete-assignment" class="toc-h2 toc-link" data-title="DELETE Assignment">DELETE Assignment</a>
                  </li>
                  <li>
                    <a href="#reopen-assignment" class="toc-h2 toc-link" data-title="REOPEN Assignment">REOPEN Assignment</a>
                  </li>
                  <li>
                    <a href="#start-assignment" class="toc-h2 toc-link" data-title="START Assignment">START Assignment</a>
                  </li>
              </ul>
          </li>
          <li>
            <a href="#grades" class="toc-h1 toc-link" data-title="Grades">Grades</a>
              <ul class="toc-list-h2">
                  <li>
                    <a href="#create-add-grade" class="toc-h2 toc-link" data-title="CREATE/ADD Grade">CREATE/ADD Grade</a>
                  </li>
                  <li>
                    <a href="#update-grade" class="toc-h2 toc-link" data-title="UPDATE Grade">UPDATE Grade</a>
                  </li>
                  <li>
                    <a href="#delete-grade" class="toc-h2 toc-link" data-title="DELETE Grade">DELETE Grade</a>
                  </li>
              </ul>
          </li>
      </ul>
    </div>
    <div class="page-wrapper">
      <div class="dark-box"></div>
      <div class="content">
        <h1 id='overview'>Overview</h1>
<p>Welcome to the CircuitVerse API! You can use our API to access CircuitVerse API endpoints, which can get information on various public projects, user projects, groups you mentor, pending assignments and a whole bunch of stuff.</p>

<aside class="success">The CircuitVerse API uses json:api specs</aside>
<h2 id='client-errors'>Client Errors</h2><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">400</span> <span class="ne">Bad Request</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"errors"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="mi">400</span><span class="p">,</span><span class="w">
      </span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"invalid parameters"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"detail"</span><span class="p">:</span><span class="w"> </span><span class="s2">"invalid parameters"</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">422</span> <span class="ne">Unprocessable Entity</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"errors"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="mi">422</span><span class="p">,</span><span class="w">
      </span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"resource invalid!"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"detail"</span><span class="p">:</span><span class="w"> </span><span class="s2">"resource invalid!"</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">401</span> <span class="ne">Unauthorized</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"errors"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="mi">401</span><span class="p">,</span><span class="w">
      </span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"not authenticated"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"detail"</span><span class="p">:</span><span class="w"> </span><span class="s2">"not authenticated"</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">403</span> <span class="ne">Forbidden</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"errors"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="mi">403</span><span class="p">,</span><span class="w">
      </span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"not authorized"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"detail"</span><span class="p">:</span><span class="w"> </span><span class="s2">"not authorized"</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">500</span> <span class="ne">Internal Server Error</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"errors"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="mi">500</span><span class="p">,</span><span class="w">
      </span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Something Unexpectedly Went Wrong! Please consider opening a github issue :)"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"detail"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Something Unexpectedly Went Wrong! Please consider opening a github issue :)"</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
<table><thead>
<tr>
<th>Error Code</th>
<th>Meaning</th>
</tr>
</thead><tbody>
<tr>
<td>400</td>
<td>Bad Request -- Your request is invalid.</td>
</tr>
<tr>
<td>401</td>
<td>Unauthorized -- Your Authentication token is wrong.</td>
</tr>
<tr>
<td>403</td>
<td>Forbidden -- The resource requested is hidden for requested user only.</td>
</tr>
<tr>
<td>404</td>
<td>Not Found -- The resource requested could not be found.</td>
</tr>
<tr>
<td>405</td>
<td>Method Not Allowed -- You tried to access a resource with an invalid method.</td>
</tr>
<tr>
<td>409</td>
<td>Conflict -- The request could not be processed due to a conflict.</td>
</tr>
<tr>
<td>429</td>
<td>Too Many Requests -- You&#39;re requesting too many resources! Slow down!</td>
</tr>
<tr>
<td>500</td>
<td>Internal Server Error -- We had a problem with our server. Try again later.</td>
</tr>
<tr>
<td>503</td>
<td>Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later.</td>
</tr>
</tbody></table>
<h2 id='authorization'>Authorization</h2>
<p>CircuitVerse API uses <code>RSASSA</code> cryptographic signing that requires <code>private</code> and associated <code>public</code> key</p>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/users/1</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjIsInVzZXJuYW1lIjoiTml0aXNoIEFnZ2Fyd2FsIiwiZW1haWwiOiJyb3lhbG5pdGlzaDIxQGdtYWlsLmNvbSJ9LCJleHAiOjE1ODkyMDI5ODF9.tHRLJeQGuLiJ1Ncc2tQSaNiQnbrnERKuOPERfZeNnF8</span>
</code></pre>
<p>You can authenticate in the API by providing the user&#39;s <code>token</code> in the <code>Authorization</code> header.</p>
<h2 id='pagination'>Pagination</h2><pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/resource?page[number]=2</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre>
<p>Requests that return multiple items will be paginated to 5 items by default.
You can specify further pages with the <code>?page[number]</code> parameter. For some resources, you can also set a custom page size with the <code>?page[size]</code> parameter.</p>
<h2 id='links'>Links</h2><pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/resources</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"resources"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
  </span><span class="s2">"links"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"self"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/resource?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"first"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/resource?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"prev"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"next"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/resource?page[number]=2"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"last"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/resource?page[number]=4"</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
<p>In each GET request that acts upon resources, there is an extra field in the response under &quot;links&quot; root element.
It includes, the links to current requested page, next page, previous page, first page and the last page for resources under the given params.</p>
<h2 id='cross-origin-resource-sharing'>Cross Origin Resource Sharing</h2>
<p>The API supports Cross Origin Resource Sharing (CORS) for requests from any origin.</p>
<h1 id='authentication'>Authentication</h1>
<p>In order to make requests that require the user to be authenticated, you must retrieve the token to be able to act on the behalf of the user.</p>
<h2 id='sign-up-a-user'>Sign Up a User</h2>
<p>This endpoint gives back the authentication token that encodes user&#39;s <code>id</code>, <code>name</code> and <code>email</code>.</p>
<h3 id='possible-exceptions'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>409</td>
<td>When user already exists.</td>
</tr>
<tr>
<td>422</td>
<td>Invalid or missing parameters.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">POST</span> <span class="nn">/api/v1/auth/signup</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test.com"</span><span class="p">,</span><span class="w">
  </span><span class="s2">"password"</span><span class="p">:</span><span class="w"> </span><span class="s2">"12345678"</span><span class="p">,</span><span class="w">
  </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Name"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">201</span> <span class="ne">CREATED</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"token"</span><span class="p">:</span><span class="w"> </span><span class="s2">"eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjIsInVzZXJuYW1lIjoiTml0aXNoIEFnZ2Fyd2FsIiwiZW1haWwiOiJyb3lhbG5pdGlzaDIxQGdtYWlsLmNvbSJ9LCJleHAiOjE1ODkyMDI5ODF9.tHRLJeQGuLiJ1Ncc2tQSaNiQnbrnERKuOPERfZeNnF8"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='login-a-user'>Login a User</h2>
<p>This endpoint gives back the authentication token that encodes user&#39;s <code>id</code>, <code>name</code> and <code>email</code>.</p>
<h3 id='possible-exceptions-2'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>Invalid password.</td>
</tr>
<tr>
<td>404</td>
<td>Non existent user tries to login.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">POST</span> <span class="nn">/api/v1/auth/login</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test.com"</span><span class="p">,</span><span class="w">
  </span><span class="s2">"password"</span><span class="p">:</span><span class="w"> </span><span class="s2">"12345678"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">202</span> <span class="ne">ACCEPTED</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"token"</span><span class="p">:</span><span class="w"> </span><span class="s2">"eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjIsInVzZXJuYW1lIjoiTml0aXNoIEFnZ2Fyd2FsIiwiZW1haWwiOiJyb3lhbG5pdGlzaDIxQGdtYWlsLmNvbSJ9LCJleHAiOjE1ODkyMDI5ODF9.tHRLJeQGuLiJ1Ncc2tQSaNiQnbrnERKuOPERfZeNnF8"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='reset-password-instructions'>Reset Password Instructions</h2>
<p>This endpoint sends an email to the user with specified <code>email</code> in POST params with instructions to reset his/her password.</p>
<h3 id='possible-exceptions-3'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>404</td>
<td>User associated with given <code>email</code> does not exists</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">POST</span> <span class="nn">/api/v1/password/forgot</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test.com"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"password reset instructions sent to test@test.com"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='get-public-key'>GET Public Key</h2>
<p>This endpoint GETs you the <code>public_key.pem</code> required to decode the token to fetch authenticated user&#39;s <code>id</code>, <code>name</code> &amp; <code>email</code>.</p>
<pre class="highlight http tab-http"><code><span class="nf">POST</span> <span class="nn">/api/v1/public_key.pem</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre>
<blockquote>
<p>TEXT response example:</p>
</blockquote>
<pre class="highlight plaintext"><code>-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3D8j5djbLuNcEwWEEU4v
Y38gIpaZrDvnec2DyRwzt+pvMuFPcrfnjAkVBTeYwiGdhH3eNSm3juJZHH506x3I
mKuQp7vo6Ni+vZVsYyA5kVuj+Qv4bR3DjFh/Hd4O2dcXfcsFgjnM7sUv6Oxa3tDi
9869O4BQNnddiOjMj2S+9NJePMWjItBMA7LwYq1n3NVQbW4m3tSb5h/V/PpVspgV
rF0ZO4xczXjGzhsapkFdibfIuac6BH74xyUwlizmu8GStap2VnFlSYiIoAEtfBp9
HKl1z24Yoa4Wu+Li9wVrKYueMjbxVicvNeOxvMEVD5/xI0o1z0rT7srzkr1TCdCd
6QIDAQAB
-----END PUBLIC KEY-----
</code></pre><h1 id='users'>Users</h1><h2 id='get-all-users'>Get All Users</h2>
<p>You can GET all users in <code>/api/v1/users</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>page[number]</code></td>
<td>The <code>number</code><sup>th</sup> page of the response</td>
</tr>
<tr>
<td><code>page[size]</code></td>
<td>The <code>size</code> of the <code>per_page</code> response</td>
</tr>
</tbody></table>
<h3 id='possible-exceptions'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/users</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"users"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"users"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 2"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"3"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"users"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 3"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"4"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"users"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 4"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"5"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"users"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 5"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"links"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"self"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/users?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"first"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/users?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"prev"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"next"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/users?page[number]=2"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"last"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/users?page[number]=4"</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='get-logged-in-user'>GET logged in User</h2>
<p>You can GET the logged in user details in <code>/api/v1/me</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='possible-exceptions-2'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/users/1</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"user"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
      </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test1.com"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"admin"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
      </span><span class="s2">"country"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
      </span><span class="s2">"educational_institute"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
      </span><span class="s2">"subscribed"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-22T12:41:28.931Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-22T12:41:29.803Z"</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='get-a-specific-user'>GET a Specific User</h2>
<p>You can GET particular user details in <code>/api/v1/users/{:id}</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-2'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the user to retrieve</td>
</tr>
</tbody></table>
<h3 id='possible-exceptions-3'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>404</td>
<td>When the requested user identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/users/1</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"user"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
      </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test1.com"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"admin"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
      </span><span class="s2">"country"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
      </span><span class="s2">"educational_institute"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
      </span><span class="s2">"subscribed"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-22T12:41:28.931Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-22T12:41:29.803Z"</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
<aside class="notice">email is serialized only if you are authorized as user associated with {:id}</aside>
<h2 id='update-a-specific-user'>UPDATE a Specific User</h2>
<p>You can UPDATE a specific user details in <code>/api/v1/users/{:id}</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-3'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the user to update</td>
</tr>
</tbody></table>
<h3 id='possible-exceptions-4'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When the user identified by <code>id</code> differs from <code>authenticated user</code></td>
</tr>
<tr>
<td>404</td>
<td>When the user identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">PATCH</span> <span class="nn">/api/v1/users/1</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1 updated"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">202</span> <span class="ne">ACCEPTED</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"user"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
      </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test1.com"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1 updated"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"admin"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
      </span><span class="s2">"country"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
      </span><span class="s2">"educational_institute"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
      </span><span class="s2">"subscribed"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-22T12:41:28.931Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-22T12:41:29.803Z"</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h1 id='projects'>Projects</h1><h2 id='get-all-projects'>GET All Projects</h2>
<p>You can GET all projects in <code>/api/v1/projects</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>optional</strong>.</p>

<p>This endpoint fetches all the <code>public projects</code> if the user is <em>not authorized</em>. If <em>authorized</em> it fetches all the projects user has access to including <code>private projects</code>.</p>
<h3 id='url-query-parameters'>URL Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>page[number]</code></td>
<td>The <code>number</code><sup>th</sup> page of the response</td>
</tr>
<tr>
<td><code>page[size]</code></td>
<td>The <code>size</code> of the <code>per_page</code> response</td>
</tr>
<tr>
<td><code>filter[tag]</code></td>
<td>The <code>projects</code> to be filtered by <code>tag</code></td>
</tr>
<tr>
<td><code>sort</code></td>
<td><code>,</code> separated <code>String</code> of <code>sortable params</code></td>
</tr>
<tr>
<td><code>include</code></td>
<td>Adds passed params details in <code>included</code> section of response</td>
</tr>
</tbody></table>

<aside class="notice">include query param accepts `author` only</aside>

<aside class="success">Sortable params include "view" & "created_at". Append "+" or "-" for ascending or descending sorting respectively.</aside>
<h3 id='possible-exceptions'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user tries to authenticate with invalid or corrupt <code>token</code>.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/projects?include=author</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token} // optional</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Simple LED"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:04:15.649Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:04:15.649Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/img/default.png"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">" &lt;p&gt;Hey there, Loving CircuitVerse&lt;/p&gt;"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-21T18:59:50.380Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-21T18:59:54.500Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/uploads/project/image_preview/11/default.png"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"3"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test 3"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:07:44.960Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:07:44.960Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/img/default.png"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">" &lt;p&gt;Hey there, Loving Circuitverse&lt;/p&gt;"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"4"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test 4"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-21T18:55:54.528Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-28T04:51:21.479Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/uploads/project/image_preview/10/preview_2020-03-22_00_25_54_%2B0530.jpeg"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"5"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test 5"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:10:18.349Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:10:18.349Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/uploads/project/image_preview/18/preview_2020-03-19_09_46_53_%2B0530.jpeg"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">" &lt;p&gt;Hey there, Loving Circuitverse&lt;/p&gt;"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"included"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"links"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"self"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/projects?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"first"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/projects?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"prev"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"next"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/projects?page[number]=2"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"last"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/projects?page[number]=4"</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='get-user-specific-projects'>GET User Specific Projects</h2>
<p>You can GET all users specific (identified by <code>:id</code>) projects in <code>/api/v1/users/:id/projects</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>

<p>This endpoint fetches user specific <code>public projects</code> if the user is <em>not authorized</em> as the user identified by <code>:id</code>. If <em>authorized</em> as the user identified by <code>:id</code> it fetches all the user specific projects including <code>private projects</code>.</p>
<h3 id='url-parameters'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> to identify the user</td>
</tr>
</tbody></table>
<h3 id='url-query-parameters-2'>URL Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>page[number]</code></td>
<td>The <code>number</code><sup>th</sup> page of the response</td>
</tr>
<tr>
<td><code>page[size]</code></td>
<td>The <code>size</code> of the <code>per_page</code> response</td>
</tr>
<tr>
<td><code>filter[tag]</code></td>
<td>The <code>projects</code> to be filtered by <code>tag</code></td>
</tr>
<tr>
<td><code>sort</code></td>
<td><code>,</code> separated <code>String</code> of <code>sortable params</code></td>
</tr>
<tr>
<td><code>include</code></td>
<td>Adds passed params details in <code>included</code> section of response</td>
</tr>
</tbody></table>

<aside class="notice">include query param accepts `author` only</aside>

<aside class="success">Sortable params include "view" & "created_at". Append "+" or "-" for ascending or descending sorting respectively.</aside>
<h3 id='possible-exceptions-2'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code></td>
</tr>
<tr>
<td>404</td>
<td>When user associated with <code>:id</code> does not exists</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/users/:id/projects?include=author</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User/Test"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Private"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-28T04:14:34.683Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-18T16:53:07.349Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/img/default.png"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">11</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test 3"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-21T18:55:54.528Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-28T04:51:21.479Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/uploads/project/image_preview/10/preview_2020-03-22_00_25_54_%2B0530.jpeg"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"3"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Simple LED"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:04:15.649Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:04:15.649Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/img/default.png"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">" &lt;p&gt;Hey there, Loving Circuitverse&lt;/p&gt;"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"4"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test 5"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-21T18:59:50.380Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-21T18:59:54.500Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/uploads/project/image_preview/11/default.png"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"5"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Simple LED"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:07:44.960Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:07:44.960Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/img/default.png"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">" &lt;p&gt;Hey there, Loving Circuitverse&lt;/p&gt;"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"included"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"links"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"self"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/users/1/projects?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"first"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/users/1/projects?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"prev"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"next"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/users/1/projects?page[number]=2"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"last"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/users/1/projects?page[number]=3"</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='get-project-details'>GET Project Details</h2>
<p>You can GET project details (identified by <code>:id</code>) in <code>/api/v1/projects/:id/</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-2'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the project to be detailed</td>
</tr>
<tr>
<td><code>include</code></td>
<td>Adds passed params details in <code>included</code> section of response</td>
</tr>
</tbody></table>

<aside class="notice">include query param accepts `author` only</aside>
<h3 id='possible-exceptions-3'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When Project is <code>private</code> or <code>authenticated user</code> doesn&#39;t have access to</td>
</tr>
<tr>
<td>404</td>
<td>When the requested project identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/projects/:id?include=author</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Simple LED"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-19T04:16:53.543Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:18:13.814Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/uploads/project/image_preview/9/preview_2020-03-19_09_46_53_%2B0530.jpeg"</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">" &lt;p&gt;Hey there, Loving Circuitverse&lt;/p&gt;"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
      </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
        </span><span class="p">{</span><span class="w">
          </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
          </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"CV"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-10T13:02:10.381Z"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-10T13:02:10.381Z"</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">],</span><span class="w">
      </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">},</span><span class="w">
  </span><span class="s2">"included"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='update-project'>UPDATE Project</h2>
<p>You can UPDATE project details (identified by <code>:id</code>) in <code>/api/v1/projects/:id/</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='list-of-acceptable-params-for-put-patch-requests-include'>List of acceptable params for put/patch requests include:</h3>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>name</code></td>
<td><code>String</code></td>
<td>Updated name of the project</td>
</tr>
<tr>
<td><code>project_access_type</code></td>
<td><code>String</code></td>
<td><code>Public</code> or <code>Private</code></td>
</tr>
<tr>
<td><code>description</code></td>
<td><code>String</code></td>
<td>Updated description of the project</td>
</tr>
<tr>
<td><code>tag_list</code></td>
<td><code>String</code></td>
<td>Comma separated String of tags</td>
</tr>
</tbody></table>
<h3 id='url-parameters-3'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the project to be detailed</td>
</tr>
<tr>
<td><code>include</code></td>
<td>Adds passed params details in <code>included</code> section of response</td>
</tr>
</tbody></table>

<aside class="notice">include query param accepts `author` only</aside>
<h3 id='possible-exceptions-4'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>400</td>
<td>When invalid parameters are used.</td>
</tr>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When Project <code>author</code> differs from <code>authenticated user</code></td>
</tr>
<tr>
<td>404</td>
<td>When the requested project identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">PATCH</span> <span class="nn">/api/v1/projects/:id?include=author</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Simple LED Updated"</span><span class="w">
    </span><span class="err">//</span><span class="w"> </span><span class="err">other</span><span class="w"> </span><span class="err">params</span><span class="w"> </span><span class="err">here</span><span class="w"> </span><span class="err">too</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">202</span> <span class="ne">ACCEPTED</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Simple LED Updated"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-19T04:16:53.543Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:18:13.814Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/uploads/project/image_preview/9/preview_2020-03-19_09_46_53_%2B0530.jpeg"</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">" &lt;p&gt;Hey there, Loving Circuitverse&lt;/p&gt;"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
      </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
        </span><span class="p">{</span><span class="w">
          </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
          </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"CV"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-10T13:02:10.381Z"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-10T13:02:10.381Z"</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">],</span><span class="w">
      </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">},</span><span class="w">
  </span><span class="s2">"included"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='delete-project'>DELETE Project</h2>
<p>You can DELETE project (identified by <code>:id</code>) in <code>/api/v1/projects/:id/</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-4'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the project to be deleted</td>
</tr>
</tbody></table>

<aside class="warning">User with author access can only delete the project</aside>
<h3 id='possible-exceptions-5'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When Project <code>author</code> differs from <code>authenticated user</code></td>
</tr>
<tr>
<td>404</td>
<td>When the requested project identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">DELETE</span> <span class="nn">/api/v1/projects/:id</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">204</span> <span class="ne">NO CONTENT</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre><h2 id='get-featured-projects'>GET Featured Projects</h2>
<p>You can GET all featured projects in <code>/api/v1/projects/featured</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-query-parameters-3'>URL Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>page[number]</code></td>
<td>The <code>number</code><sup>th</sup> page of the response</td>
</tr>
<tr>
<td><code>page[size]</code></td>
<td>The <code>size</code> of the <code>per_page</code> response</td>
</tr>
<tr>
<td><code>filter[tag]</code></td>
<td>The <code>projects</code> to be filtered by <code>tag</code></td>
</tr>
<tr>
<td><code>sort</code></td>
<td><code>,</code> separated <code>String</code> of <code>sortable params</code></td>
</tr>
<tr>
<td><code>include</code></td>
<td>Adds passed params details in <code>included</code> section of response</td>
</tr>
</tbody></table>

<aside class="notice">include query param accepts `author` only</aside>

<aside class="success">Sortable params include "view" & "created_at". Append "+" or "-" for ascending or descending sorting respectively.</aside>
<h3 id='possible-exceptions-6'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/projects/featured?include=author</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Simple LED"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-19T04:16:53.543Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:18:13.814Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/uploads/project/image_preview/9/preview_2020-03-19_09_46_53_%2B0530.jpeg"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">" &lt;p&gt;Hey there, Loving Circuitverse&lt;/p&gt;"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
          </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
            </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"CV"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-10T13:02:10.381Z"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-10T13:02:10.381Z"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">],</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"included"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"links"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"self"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/projects/featured?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"first"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/projects/featured?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"prev"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"next"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"last"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/projects/featured?page[number]=1"</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='star-unstar-a-project'>STAR/UNSTAR a Project</h2>
<p>You can star or unstar a project in <code>/api/v1/projects/:id/toggle-star</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-5'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the project to be starred</td>
</tr>
</tbody></table>
<h3 id='possible-exceptions-7'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>404</td>
<td>When the requested project identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/projects/:id/toggle-star</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Starred/Unstarred successfully!"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='fork-a-project'>FORK a Project</h2>
<p>You can FORK a project (identified by <code>:id</code>) in <code>/api/v1/projects/:id/fork</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-6'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the project to be detailed</td>
</tr>
</tbody></table>

<aside class="notice">author details in the included section</aside>
<h3 id='possible-exceptions-8'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>409</td>
<td>When user tries ot fork his/her own project</td>
</tr>
<tr>
<td>404</td>
<td>When the requested project identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">POST</span> <span class="nn">/api/v1/projects/:id/fork</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User/Simple LED"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Public"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-19T04:16:53.543Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-10T13:18:13.814Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/uploads/project/image_preview/9/preview_2020-03-19_09_46_53_%2B0530.jpeg"</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">" &lt;p&gt;Hey there, Loving Circuitverse&lt;/p&gt;"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
      </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
        </span><span class="p">{</span><span class="w">
          </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
          </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"CV"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-10T13:02:10.381Z"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-10T13:02:10.381Z"</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">],</span><span class="w">
      </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h1 id='collaborators'>Collaborators</h1><h2 id='get-all-project-collaborators'>GET All project collaborators</h2>
<p>You can GET all collaborators for a particular project in <code>/api/v1/projects/:project_id/collaborators</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-query-parameters'>URL Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>page[number]</code></td>
<td>The <code>number</code><sup>th</sup> page of the response</td>
</tr>
<tr>
<td><code>page[size]</code></td>
<td>The <code>size</code> of the <code>per_page</code> response</td>
</tr>
</tbody></table>
<h3 id='possible-exceptions'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user tries to authenticate with invalid or corrupt <code>token</code>.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/projects/:project_id/collaborators</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"user"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Collaborator's Name"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"links"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"self"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/projects/1/collaborators?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"first"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/projects/1/collaborators?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"prev"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"next"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"last"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/projects/1/collaborators?page[number]=1"</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='create-add-collaborator'>CREATE/ADD Collaborator</h2>
<p>Project author can add collaborators to his/her project in <code>/api/v1/projects/:project_id/collaborators</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>project_id</code></td>
<td>The <code>id</code> of the project, collaborators are to be added</td>
</tr>
</tbody></table>

<aside class="notice">emails in POST request is comma separated string of emails</aside>

<aside class="warning">You cannot add yourself as a collaborator</aside>
<h3 id='possible-exceptions-2'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-author user tries to add collaborators to the project</td>
</tr>
<tr>
<td>404</td>
<td>When the requested project identified by <code>project_id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">POST</span> <span class="nn">/api/v1/projects/:project_id/collaborators</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"emails"</span><span class="p">:</span><span class="w"> </span><span class="s2">"newuser@test.com, alreadyCollaborating@test.com, NA"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"added"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"newuser@test.com"</span><span class="p">],</span><span class="w">
  </span><span class="s2">"existing"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"alreadyCollaborating@test.com"</span><span class="p">],</span><span class="w">
  </span><span class="s2">"invalid"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"NA"</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='delete-collaborator'>DELETE Collaborator</h2>
<p>Project author can DELETE a collaborator (identified by <code>:id</code>) in <code>/api/v1/projects/:project_id/collaborators/:id</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-2'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>project_id</code></td>
<td>The <code>id</code> of the project, collaborators are to be deleted of</td>
</tr>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the collaborating member</td>
</tr>
</tbody></table>

<aside class="warning">User with author access can only delete a collaborator</aside>
<h3 id='possible-exceptions-3'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-author user tries to delete the collaborator</td>
</tr>
<tr>
<td>404</td>
<td>When the requested project identified by <code>project_id</code> does not exists.</td>
</tr>
<tr>
<td>404</td>
<td>When the requested collaborator identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">DELETE</span> <span class="nn">/api/v1/projects/:project_id/collaborators/:id</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">204</span> <span class="ne">NO CONTENT</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre><h1 id='groups'>Groups</h1><h2 id='get-all-your-groups'>GET All your groups</h2>
<p>You can GET all groups you are a member of in <code>/api/v1/groups</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-query-parameters'>URL Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>page[number]</code></td>
<td>The <code>number</code><sup>th</sup> page of the response</td>
</tr>
<tr>
<td><code>page[size]</code></td>
<td>The <code>size</code> of the <code>per_page</code> response</td>
</tr>
<tr>
<td><code>include</code></td>
<td>Adds passed params details in <code>included</code></td>
</tr>
</tbody></table>

<aside class="notice">include query param accepts `group_members` & `assignments` in comma separated string</aside>

<aside class="success">You may include one or both of the allowed included resources and the JSON response will be formatted accordingly</aside>
<h3 id='possible-exceptions'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user tries to authenticate with invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>404</td>
<td>When user has no groups associated with him/her.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/groups?include=group_members,assignments</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example (including <code>group_members</code> &amp; <code>assignments</code>):</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"member_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"mentor_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Mentor"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Group 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"mentor_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:39.825Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:39.825Z"</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_members"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">]</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"assignments"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">]</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"member_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"mentor_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Mentor"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Group 2"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"mentor_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-27T11:08:54.886Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-27T11:08:54.886Z"</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_members"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="w">
            </span><span class="p">},</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"3"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">]</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"assignments"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"3"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"member_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"mentor_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Mentor"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Group 3"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"mentor_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-13T15:14:53.948Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-13T15:14:53.948Z"</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_members"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"4"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">]</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"assignments"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"4"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"member_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"mentor_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Mentor"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Group 4"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"mentor_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-22T12:42:04.511Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-03-22T12:42:04.511Z"</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_members"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"5"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">]</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"assignments"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">]</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"included"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test assignment 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test description"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"has_mentor_access"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
        </span><span class="s2">"current_user_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grading_scale"</span><span class="p">:</span><span class="w"> </span><span class="s2">"no_scale"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grades_finalized"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
        </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[]"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test assignment 2"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-05-24T11:48:26.739Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test description"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:48:26.740Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:48:26.740Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"has_mentor_access"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
        </span><span class="s2">"current_user_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grading_scale"</span><span class="p">:</span><span class="w"> </span><span class="s2">"no_scale"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grades_finalized"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
        </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[]"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"user_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test1.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
        </span><span class="s2">"user_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 2"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test2.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"3"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
        </span><span class="s2">"user_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 3"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test3.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"4"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w">
        </span><span class="s2">"user_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 4"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test4.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"5"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w">
        </span><span class="s2">"user_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 5"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test5.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"links"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"self"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/groups?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"first"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/groups?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"prev"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"next"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"last"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/groups?page[number]=1"</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='get-all-mentored-groups'>GET All mentored groups</h2>
<p>You can GET all groups you mentor in <code>/api/v1/groups/mentored</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-query-parameters-2'>URL Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>page[number]</code></td>
<td>The <code>number</code><sup>th</sup> page of the response</td>
</tr>
<tr>
<td><code>page[size]</code></td>
<td>The <code>size</code> of the <code>per_page</code> response</td>
</tr>
<tr>
<td><code>include</code></td>
<td>Adds passed params details in <code>included</code></td>
</tr>
</tbody></table>

<aside class="notice">include query param accepts `group_members` & `assignments` in comma separated string</aside>

<aside class="success">You may include one or both of the allowed included resources and the JSON response will be formatted accordingly</aside>
<h3 id='possible-exceptions-2'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user tries to authenticate with invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>404</td>
<td>When user has no groups associated with him/her.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/groups/mentored?include=group_members,assignments</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response will be similiar as above</p>
</blockquote>
<h2 id='get-group-details'>GET Group Details</h2>
<p>You can GET group details (identified by <code>:id</code>) in <code>/api/v1/groups/:id/</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the project to be detailed</td>
</tr>
</tbody></table>

<aside class="notice">group_members & assignments details in the included section</aside>
<h3 id='possible-exceptions-3'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When authenticated user is neither mentor nor user of the Group</td>
</tr>
<tr>
<td>404</td>
<td>When the requested group identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/groups/:id?include=group_members,assignments</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"member_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
      </span><span class="s2">"mentor_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Mentor"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Group 1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"mentor_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:39.825Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:39.825Z"</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"group_members"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
          </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">]</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"assignments"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
          </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">]</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">},</span><span class="w">
  </span><span class="s2">"included"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test assignment 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test description"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"has_mentor_access"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
        </span><span class="s2">"current_user_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grading_scale"</span><span class="p">:</span><span class="w"> </span><span class="s2">"no_scale"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grades_finalized"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
        </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[]"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"user_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test1.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='update-group'>UPDATE Group</h2>
<p>You can UPDATE group details (identified by <code>:id</code>) in <code>/api/v1/groups/:id/</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='list-of-acceptable-params-for-put-patch-requests-include'>List of acceptable params for put/patch requests include:</h3>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>name</code></td>
<td><code>String</code></td>
<td>Updated name of the group</td>
</tr>
<tr>
<td><code>mentor_id</code></td>
<td><code>String</code></td>
<td>Mentor identified by id</td>
</tr>
</tbody></table>
<h3 id='url-parameters-2'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the group to be updated</td>
</tr>
</tbody></table>
<h3 id='possible-exceptions-4'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>400</td>
<td>When invalid parameters are used.</td>
</tr>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-mentor user tries to update the group</td>
</tr>
<tr>
<td>404</td>
<td>When the requested group identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">PATCH</span> <span class="nn">/api/v1/groups/:id</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"group"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Group Name Updated"</span><span class="w">
    </span><span class="err">//</span><span class="w"> </span><span class="err">other</span><span class="w"> </span><span class="err">params</span><span class="w"> </span><span class="err">here</span><span class="w"> </span><span class="err">too</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">202</span> <span class="ne">ACCEPTED</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"member_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
      </span><span class="s2">"mentor_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Mentor"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Group Name Updated"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"mentor_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:39.825Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:39.825Z"</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"group_members"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
          </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">]</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"assignments"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
          </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">]</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">},</span><span class="w">
  </span><span class="s2">"included"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test assignment 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test description"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"has_mentor_access"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
        </span><span class="s2">"current_user_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grading_scale"</span><span class="p">:</span><span class="w"> </span><span class="s2">"no_scale"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grades_finalized"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
        </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[]"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"user_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test1.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='delete-group'>DELETE Group</h2>
<p>Group mentor can DELETE a group (identified by <code>:id</code>) in <code>/api/v1/groups/:id/</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-3'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the group to be deleted</td>
</tr>
</tbody></table>

<aside class="warning">User with mentor or admin access can only delete the group</aside>
<h3 id='possible-exceptions-5'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-mentor user tries to update the group</td>
</tr>
<tr>
<td>404</td>
<td>When the requested group identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">DELETE</span> <span class="nn">/api/v1/groups/:id</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">204</span> <span class="ne">NO CONTENT</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre><h1 id='group-members'>Group Members</h1><h2 id='get-all-group-members'>GET All group members</h2>
<p>You can GET all group members for a particular group in <code>/api/v1/groups/:group_id/members</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-query-parameters'>URL Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>page[number]</code></td>
<td>The <code>number</code><sup>th</sup> page of the response</td>
</tr>
<tr>
<td><code>page[size]</code></td>
<td>The <code>size</code> of the <code>per_page</code> response</td>
</tr>
</tbody></table>
<h3 id='possible-exceptions'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user tries to authenticate with invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>404</td>
<td>When group has no groups members associated with it.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/groups/:group_id/members</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"group_member"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"group_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"user_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-02-25T18:15:52.890Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@test.com"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"links"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"self"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/groups/1/group_members?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"first"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/groups/1/group_members?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"prev"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"next"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"last"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/groups/1/group_members?page[number]=1"</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='create-add-group-member'>CREATE/ADD Group Member</h2>
<p>You can add members to your group in <code>/api/v1/groups/:group_id/members</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>group_id</code></td>
<td>The <code>id</code> of the group, members are to be fetched</td>
</tr>
</tbody></table>

<aside class="notice">emails in POST request is comma separated string of emails</aside>
<h3 id='possible-exceptions-2'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-mentor user tries to add members to the group</td>
</tr>
<tr>
<td>404</td>
<td>When the requested group identified by <code>group_id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">POST</span> <span class="nn">/api/v1/groups/:group_id/members</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"emails"</span><span class="p">:</span><span class="w"> </span><span class="s2">"newuser@test.com, alreadyexists@test.com, NA"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"added"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"alreadyexists@test.com"</span><span class="p">],</span><span class="w">
  </span><span class="s2">"pending"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"newuser@test.com"</span><span class="p">],</span><span class="w">
  </span><span class="s2">"invalid"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"NA"</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='delete-group-member'>DELETE Group Member</h2>
<p>Group mentor can DELETE a group member (identified by <code>:id</code>) in <code>/api/v1/group/members/:id/</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-2'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the group member to be deleted</td>
</tr>
</tbody></table>

<aside class="warning">User with mentor or admin access can only delete the group member</aside>
<h3 id='possible-exceptions-3'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-mentor user tries to delete the group member</td>
</tr>
<tr>
<td>404</td>
<td>When the requested group member identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">DELETE</span> <span class="nn">/api/v1/group/members/:id</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">204</span> <span class="ne">NO CONTENT</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre><h1 id='assignments'>Assignments</h1><h2 id='get-group-39-s-assignments'>GET Group&#39;s Assignments</h2>
<p>You can GET all the assignments for the group you have access to in <code>/api/v1/groups/:group_id/assignments</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-query-parameters'>URL Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>page[number]</code></td>
<td>The <code>number</code><sup>th</sup> page of the response</td>
</tr>
<tr>
<td><code>page[size]</code></td>
<td>The <code>size</code> of the <code>per_page</code> response</td>
</tr>
<tr>
<td><code>include</code></td>
<td>Adds passed params details in <code>included</code></td>
</tr>
</tbody></table>

<aside class="notice">include query param accepts `grades` & `projects` in comma separated string</aside>

<aside class="warning">Only users with show access can fetch the assignments</aside>
<h3 id='possible-exceptions'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user tries to authenticate with invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When user without show access tries to fetch assignments</td>
</tr>
<tr>
<td>404</td>
<td>When the group identified by :group_id does not exist</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/groups/:group_id/assignments?include=grades,projects</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example :</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test assignment 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment description"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[</span><span class="se">\"</span><span class="s2">Input</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">ConstantVal</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Splitter</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Random</span><span class="se">\"</span><span class="s2">]"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"has_mentor_access"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
        </span><span class="s2">"current_user_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grading_scale"</span><span class="p">:</span><span class="w"> </span><span class="s2">"no_scale"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grades_finalized"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"projects"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">]</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"grades"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"grade"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">]</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test assignment 2"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment description"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[</span><span class="se">\"</span><span class="s2">Input</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">ConstantVal</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Splitter</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Random</span><span class="se">\"</span><span class="s2">]"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"has_mentor_access"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
        </span><span class="s2">"current_user_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grading_scale"</span><span class="p">:</span><span class="w"> </span><span class="s2">"no_scale"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"grades_finalized"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"projects"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">]</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"grades"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
            </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"grade"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">]</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"included"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"grade"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"grade"</span><span class="p">:</span><span class="w"> </span><span class="s2">"A"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"remarks"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-25T13:37:51.049Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-25T13:37:51.049Z"</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1/Test Project 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Private"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-12T08:19:05.139Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-12T08:19:05.139Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/img/default.png"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"author_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"grade"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"grade"</span><span class="p">:</span><span class="w"> </span><span class="s2">"A"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"remarks"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-25T13:37:51.049Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-25T13:37:51.049Z"</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 2/Test Project 2"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Private"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-12T08:19:05.139Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-12T08:19:05.139Z"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/img/default.png"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
        </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
        </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
        </span><span class="s2">"author_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 2"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="s2">"links"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"self"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/groups/1/assignments?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"first"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/groups/1/assignments?page[number]=1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"prev"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"next"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
    </span><span class="s2">"last"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://localhost:3000/api/v1/groups/1/assignments?page[number]=1"</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='get-assignment-details'>GET Assignment details</h2>
<p>You can GET assignment details (identified by <code>:id</code>) in <code>/api/v1/assignments/:id/</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the assignment to be detailed</td>
</tr>
</tbody></table>
<h3 id='url-query-paramters'>URL Query Paramters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>include</code></td>
<td>Adds passed params details in <code>included</code></td>
</tr>
</tbody></table>

<aside class="notice">include query param accepts `grades` & `projects` in comma separated string</aside>
<h3 id='possible-exceptions-2'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When authenticated user is neither mentor nor user of the Group</td>
</tr>
<tr>
<td>404</td>
<td>When the requested assignment identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">GET</span> <span class="nn">/api/v1/assignments/:id?include=grades,projects</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test assignment 1"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment description"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-05-24T11:47:40.244Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[</span><span class="se">\"</span><span class="s2">Input</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">ConstantVal</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Splitter</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Random</span><span class="se">\"</span><span class="s2">]"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"has_mentor_access"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
      </span><span class="s2">"current_user_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
      </span><span class="s2">"grading_scale"</span><span class="p">:</span><span class="w"> </span><span class="s2">"no_scale"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"grades_finalized"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"projects"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
          </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">]</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"grades"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
          </span><span class="p">{</span><span class="w">
            </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
            </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"grade"</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">]</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"included"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
      </span><span class="p">{</span><span class="w">
        </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"grade"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"grade"</span><span class="p">:</span><span class="w"> </span><span class="s2">"A"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"remarks"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
          </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-25T13:37:51.049Z"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-25T13:37:51.049Z"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="p">{</span><span class="w">
        </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1/Project 1"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"project_access_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Private"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-12T08:19:05.139Z"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-12T08:19:05.139Z"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"image_preview"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/img/default.png"</span><span class="w">
          </span><span class="p">},</span><span class="w">
          </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
          </span><span class="s2">"view"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
          </span><span class="s2">"tags"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
          </span><span class="s2">"author_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test User 1"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"stars_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
              </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2"</span><span class="p">,</span><span class="w">
              </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"author"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">]</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='post-assignment'>POST Assignment</h2>
<p>You can POST assignment in <code>/api/v1/groups/:group_id/assignments</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='list-of-acceptable-params-for-post-request-include'>List of acceptable params for post request include:</h3>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>name</code></td>
<td><code>String</code></td>
<td>Name of the Assignment</td>
</tr>
<tr>
<td><code>deadline</code></td>
<td><code>String</code></td>
<td>Updated name of the group</td>
</tr>
<tr>
<td><code>description</code></td>
<td><code>String</code></td>
<td>Description of the assignment</td>
</tr>
<tr>
<td><code>grading_scale</code></td>
<td><code>String</code></td>
<td>grading scale for the assignment</td>
</tr>
<tr>
<td><code>restrictions</code></td>
<td><code>JSON encoded array</code></td>
<td>restrictions for assignments in json string</td>
</tr>
</tbody></table>
<h3 id='url-parameters-2'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>group_id</code></td>
<td>The <code>id</code> of the group, assignment is to be added</td>
</tr>
</tbody></table>
<h3 id='url-query-paramters-2'>URL Query Paramters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>include</code></td>
<td>Adds passed params details in <code>included</code></td>
</tr>
</tbody></table>

<aside class="notice">include query param accepts `grades` & `projects` in comma separated string</aside>

<aside class="warning">The grading_scale cannot be changed later on</aside>
<h3 id='possible-exceptions-3'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>400</td>
<td>When invalid parameters are used.</td>
</tr>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-mentor user tries to add the assignment</td>
</tr>
<tr>
<td>404</td>
<td>When the requested group identified by <code>group_id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">POST</span> <span class="nn">/api/v1/groups/:group_id/assignments</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test assignment"</span><span class="p">,</span><span class="w">
  </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"date_time_string"</span><span class="p">,</span><span class="w">
  </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test description"</span><span class="p">,</span><span class="w">
  </span><span class="s2">"grading_scale"</span><span class="p">:</span><span class="w"> </span><span class="s2">"letter"</span><span class="p">,</span><span class="w">
  </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[</span><span class="se">\"</span><span class="s2">Input</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">ConstantVal</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Splitter</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Random</span><span class="se">\"</span><span class="s2">]"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">202</span> <span class="ne">ACCEPTED</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Assignment"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-18T18:00:00.000Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
      </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[</span><span class="se">\"</span><span class="s2">Input</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">ConstantVal</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Splitter</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Random</span><span class="se">\"</span><span class="s2">]"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"has_mentor_access"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
      </span><span class="s2">"current_user_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-11T10:34:55.009Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-25T16:55:42.317Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"grading_scale"</span><span class="p">:</span><span class="w"> </span><span class="s2">"letter"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"grades_finalized"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"projects"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"grades"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='update-assignment'>UPDATE Assignment</h2>
<p>You can PATCH assignment details in <code>/api/v1/assignments/:id</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='list-of-acceptable-params-for-put-patch-request-include'>List of acceptable params for put/patch request include:</h3>
<table><thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>name</code></td>
<td><code>String</code></td>
<td>Name of the Assignment</td>
</tr>
<tr>
<td><code>deadline</code></td>
<td><code>String</code></td>
<td>Updated name of the group</td>
</tr>
<tr>
<td><code>description</code></td>
<td><code>String</code></td>
<td>Description of the assignment</td>
</tr>
<tr>
<td><code>restrictions</code></td>
<td><code>JSON String</code></td>
<td>restrictions for assignments in json string</td>
</tr>
</tbody></table>
<h3 id='url-parameters-3'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the assignment to be updated</td>
</tr>
</tbody></table>
<h3 id='possible-exceptions-4'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>400</td>
<td>When invalid parameters are used.</td>
</tr>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-mentor user tries to update the assignment</td>
</tr>
<tr>
<td>404</td>
<td>When the requested assignment identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">PATCH</span> <span class="nn">/api/v1/assignments/:id</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test assignment Updated"</span><span class="p">,</span><span class="w">
  </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"date_time_string"</span><span class="p">,</span><span class="w">
  </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test description"</span><span class="p">,</span><span class="w">
  </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[</span><span class="se">\"</span><span class="s2">Input</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Splitter</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Random</span><span class="se">\"</span><span class="s2">]"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">202</span> <span class="ne">ACCEPTED</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assignment"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test Assignment Updated"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"deadline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-18T18:00:00.000Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Test description"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"restrictions"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[</span><span class="se">\"</span><span class="s2">Input</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Splitter</span><span class="se">\"</span><span class="s2">,</span><span class="se">\"</span><span class="s2">Random</span><span class="se">\"</span><span class="s2">]"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"has_mentor_access"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
      </span><span class="s2">"current_user_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-11T10:34:55.009Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-25T16:55:42.317Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"grading_scale"</span><span class="p">:</span><span class="w"> </span><span class="s2">"letter"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"grades_finalized"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"projects"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
      </span><span class="p">},</span><span class="w">
      </span><span class="s2">"grades"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='delete-assignment'>DELETE Assignment</h2>
<p>Group mentor can DELETE a assignment (identified by <code>:id</code>) in <code>/api/v1/assignments/:id/</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-4'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the assignment to be deleted</td>
</tr>
</tbody></table>

<aside class="warning">User with mentor or admin access can only delete the assignment</aside>
<h3 id='possible-exceptions-5'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-mentor user tries to delete the assignment</td>
</tr>
<tr>
<td>404</td>
<td>When the requested assignment identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">DELETE</span> <span class="nn">/api/v1/assignment/:id</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">204</span> <span class="ne">NO CONTENT</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre><h2 id='reopen-assignment'>REOPEN Assignment</h2>
<p>Mentor can REOPEN a closed assignment to extend the deadline by 1 day in <code>/api/v1/assignments/:id/reopen</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-5'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the assignment to be reopened</td>
</tr>
</tbody></table>

<aside class="notice">Reopened assignment's deadline is increased by one day</aside>
<h3 id='possible-exceptions-6'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When authenticated user is neither mentor nor user of the Group</td>
</tr>
<tr>
<td>404</td>
<td>When the requested assignment identified by <code>id</code> does not exists.</td>
</tr>
<tr>
<td>409</td>
<td>When the requested assignment identified by <code>id</code> is already opened.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">PATCH</span> <span class="nn">/api/v1/assignments/:id/reopen</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">202</span> <span class="ne">ACCEPTED</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Assignment has been reopened!"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='start-assignment'>START Assignment</h2>
<p>Group Members can start working on the assignment in<code>/api/v1/assignments/:id/start</code>. This creates a new private project for he user to work upon. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-6'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the assignment to be start working on</td>
</tr>
</tbody></table>

<aside class="notice">Created Private Project's name is #{username}/#{assignment_name}</aside>
<h3 id='possible-exceptions-7'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When authenticated user isn&#39;t a user of the Group, assignment is part of</td>
</tr>
<tr>
<td>404</td>
<td>When the requested assignment identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">PATCH</span> <span class="nn">/api/v1/assignments/:id/start</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">201</span> <span class="ne">CREATED</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Voila! Project set up under name #{@project.name}"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h1 id='grades'>Grades</h1><h2 id='create-add-grade'>CREATE/ADD Grade</h2>
<p>You can grade an assignment in <code>/api/v1/assignments/:assignment_id/projects/:project_id/grades</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>assignment_id</code></td>
<td>The <code>id</code> of the assignment project belongs to</td>
</tr>
<tr>
<td><code>project_id</code></td>
<td>The <code>id</code> of the the project you wish to grade</td>
</tr>
</tbody></table>

<aside class="warning">The assignment can only be graded by group mentor</aside>
<h3 id='possible-exceptions'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-mentor user tries to grade the assignment</td>
</tr>
<tr>
<td>404</td>
<td>When the assignment identified by <code>assignment_id</code> does not exists.</td>
</tr>
<tr>
<td>422</td>
<td>When created grade has validation errors</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">POST</span> <span class="nn">/api/v1/assignments/:assignment_id/projects/:project_id/grade</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"grade"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"grade"</span><span class="p">:</span><span class="w"> </span><span class="s2">"A"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"remarks"</span><span class="p">:</span><span class="w"> </span><span class="s2">"This is the remark.."</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">201</span> <span class="ne">CREATED</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"grade"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"grade"</span><span class="p">:</span><span class="w"> </span><span class="s2">"A"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"remarks"</span><span class="p">:</span><span class="w"> </span><span class="s2">"This is the remark.."</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-11T04:02:44.466Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-11T04:02:44.466Z"</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='update-grade'>UPDATE Grade</h2>
<p>You can update grade identified by <code>:id</code> in <code>/api/v1/grades/:id</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-2'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the grade to be updated</td>
</tr>
</tbody></table>

<aside class="warning">The grade can only be updated by group mentor</aside>
<h3 id='possible-exceptions-2'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-mentor user tries to update grade for the assignment</td>
</tr>
<tr>
<td>404</td>
<td>When the grade identified by <code>id</code> does not exists.</td>
</tr>
<tr>
<td>422</td>
<td>When updated grade has validation errors</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">POST</span> <span class="nn">/api/v1/assignments/:assignment_id/projects/:project_id/grade</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"grade"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"grade"</span><span class="p">:</span><span class="w"> </span><span class="s2">"B"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"remarks"</span><span class="p">:</span><span class="w"> </span><span class="s2">"This is the updated remark.."</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">202</span> <span class="ne">ACCEPTED</span>
</code></pre>
<blockquote>
<p>JSON response example:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
  </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"grade"</span><span class="p">,</span><span class="w">
    </span><span class="s2">"attributes"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"grade"</span><span class="p">:</span><span class="w"> </span><span class="s2">"B"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"remarks"</span><span class="p">:</span><span class="w"> </span><span class="s2">"This is the updated remark.."</span><span class="p">,</span><span class="w">
      </span><span class="s2">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-11T04:02:44.466Z"</span><span class="p">,</span><span class="w">
      </span><span class="s2">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2020-06-11T04:02:44.466Z"</span><span class="w">
    </span><span class="p">},</span><span class="w">
    </span><span class="s2">"relationships"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="s2">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="p">,</span><span class="w">
          </span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h2 id='delete-grade'>DELETE Grade</h2>
<p>Group mentor can DELETE a grade (identified by <code>:id</code>) in <code>/api/v1/grades/:id/</code>. Authentication <code>token</code> is passed through <code>Authorization</code> header and is <strong>required</strong>.</p>
<h3 id='url-parameters-3'>URL Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>The <code>id</code> of the grade to be deleted</td>
</tr>
</tbody></table>

<aside class="warning">User with mentor or admin access can only delete the grades</aside>
<h3 id='possible-exceptions-3'>Possible exceptions</h3>
<table><thead>
<tr>
<th>Error Code</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>401</td>
<td>When user is not authenticated i.e invalid or corrupt <code>token</code>.</td>
</tr>
<tr>
<td>403</td>
<td>When non-mentor user tries to delete the grade</td>
</tr>
<tr>
<td>404</td>
<td>When the requested grade identified by <code>id</code> does not exists.</td>
</tr>
</tbody></table>
<pre class="highlight http tab-http"><code><span class="nf">DELETE</span> <span class="nn">/api/v1/grades/:id</span> <span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span>
<span class="na">Accept</span><span class="p">:</span> <span class="s">application/json</span>
<span class="na">Authorization</span><span class="p">:</span> <span class="s">Token {token}</span>
<span class="na">Host</span><span class="p">:</span> <span class="s">localhost</span>
</code></pre><pre class="highlight http tab-http"><code><span class="k">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">204</span> <span class="ne">NO CONTENT</span>
<span class="na">Content-Type</span><span class="p">:</span> <span class="s">application/json</span>
</code></pre>
      </div>
      <div class="dark-box">
          <div class="lang-selector">
                <a href="#" data-language-name="http">http</a>
          </div>
      </div>
    </div>
  </body>
</html>
